home *** CD-ROM | disk | FTP | other *** search
- // TreeViewToolTip.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "winhttrack.h"
- #include "TreeViewToolTip.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CTreeViewToolTip
-
- CTreeViewToolTip::CTreeViewToolTip()
- {
- EnableToolTips(true);
- }
-
- CTreeViewToolTip::~CTreeViewToolTip()
- {
- }
-
-
- BEGIN_MESSAGE_MAP(CTreeViewToolTip, CToolTipCtrl)
- //{{AFX_MSG_MAP(CTreeViewToolTip)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CTreeViewToolTip message handlers
-
-
-
- // ------------------------------------------------------------
- // TOOL TIPS
- //
- // ajouter dans le .cpp:
- // remplacer les deux Wid1:: par le nom de la classe::
- // dans la message map, ajouter
- // ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
- // dans initdialog ajouter
- // EnableToolTips(true); // TOOL TIPS
- //
- // ajouter dans le .h:
- // char* GetTip(int id);
- // et en generated message map
- // afx_msg BOOL OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult );
- BOOL CTreeViewToolTip::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
- {
- TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
- UINT nID =pNMHDR->idFrom;
- if (pTTT->uFlags & TTF_IDISHWND)
- {
- // idFrom is actually the HWND of the tool
- nID = ::GetDlgCtrlID((HWND)nID);
- if(nID)
- {
- char* st=GetTip(nID);
- if (st != "") {
- pTTT->lpszText = st;
- pTTT->hinst = AfxGetResourceHandle();
- return(TRUE);
- }
- }
- }
- return(FALSE);
- }
- char* CTreeViewToolTip::GetTip(int ID)
- {
- /*
- switch(ID) {
- case 0: return ""; break;
- }
- */
- return "[File]";
- }
- // TOOL TIPS
- // ------------------------------------------------------------
-
-
-